package com.huluobo.a2206douyindemo.mvpdemo;

/**
 * Created by LC on 2024/8/14.
 */
public class LoginDemoPresenter {
    LoginDemoModel loginDemoModel = new LoginDemoModel();

    LoginDemoView loginDemoView;

    public LoginDemoPresenter(LoginDemoView loginDemoView) {
        this.loginDemoView = loginDemoView;
    }

    public void login(String username, String password) {
        UserBean userBean = loginDemoModel.login(username, password);
        if (userBean != null) {
            loginDemoView.onSuccess(userBean);
        } else {
            loginDemoView.onFailed("登录失败");
        }
    }

}
